package com.yzx.codedemo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * 学生实体类
 *
 * @author 伦裕如
 * @since 2024-04-16
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class Student implements Comparable<Student> {

    /**
     * 学生姓名
     */
    private String name;
    /**
     * 学生成绩
     */
    private BigDecimal score;
    /**
     * class是关键字，用classroom当班级了
     */
    private String classroom;

    @Override
    public int compareTo(Student stu) {
        return stu.score.compareTo(this.score);
    }
}
